//
//  LocationSearch.h
//  didacar
//
//  Created by 度周末网络-王腾 on 15/11/30.
//  Copyright © 2015年 dzmmac. All rights reserved.
//

#import "BaseViewModel.h"
#import <MAMapKit/MAMapKit.h>
#import <AMapSearchKit/AMapSearchAPI.h>
#import "PoisModel.h"

@interface LocationSearchViewModel : BaseViewModel <AMapSearchDelegate,MAMapViewDelegate>

@property (strong, nonatomic) AMapSearchAPI *search;
@property (assign, nonatomic) BOOL isSearch;
@property (strong, nonatomic) AMapPlaceSearchRequest *request;

// 输入搜索
@property (strong, nonatomic) NSString *requestTip;
@property (strong, nonatomic) NSMutableArray *searchPois;
@property (assign, nonatomic) BOOL searchBMore;
@property (assign, nonatomic) NSInteger searchPageIndex;
@property (assign, nonatomic) NSInteger searchPageCount;

// poi搜索
@property (nonatomic, strong) NSMutableArray *pois;
@property (assign, nonatomic) BOOL bMore;
@property (assign, nonatomic) NSInteger poiPageCount;

@property (copy, nonatomic) DealDataResultBlock requestPoiBlock;
@property (copy, nonatomic) DealDataResultBlock requestTipBlock;
@property (copy, nonatomic) DealDataResultBlock goecodeBlock;

@property (nonatomic, assign) CLLocationCoordinate2D loadMoreCLLocation;

// 逆地理编码当前位置对象
@property (strong, nonatomic) PoisModel *currentPoisModel;

/**
 *  逆地理编码
 *
 *  @param cllocation  经纬度
 *  @param reslutBlock 回调
 */
-(void)requestGoecodeSearch:(CLLocationCoordinate2D)cllocation reslutBlock:(DealDataResultBlock)reslutBlock;

/**
 *  poi热点搜索
 *
 *  @param cllocation  中心经纬度
 *  @param reslutBlock 回调
 */
-(void)requestPoi:(CLLocationCoordinate2D)cllocation reslutBlock:(DealDataResultBlock)reslutBlock;

/* poi热点搜索加载更多 */
-(void)loadMorePoiSearchReslutBlock:(DealDataResultBlock)reslutBlock;

/**
 *  关键字搜索
 *
 *  @param reslutBlock 回调
 */
-(void)requestTipReslutBlock:(DealDataResultBlock)reslutBlock;

/* 关键字搜索加载更多 */
-(void)loadMoreTipSearchReslutBlock:(DealDataResultBlock)reslutBlock;

@end
